docs(api): re-sync the API reference with the current backends - #299
Merged
Conversation
Silence, inhibit and unsubscribe rules no longer accept or return `priority`. The matching engine evaluates these rules in creation order, so the field never affected behavior and its "lower runs first" wording misdescribed how rules are ordered. Remove it from the drop-rule create/update request schemas, which still declared it, and from the silence/inhibit/unsubscribe list-response examples, which still showed it. Escalation and subscription rules keep `priority` — theirs is genuinely used for matching and ordering.
Knowledge packs now carry `duty_version`, the pack version at which DUTY.md was last authored or re-affirmed. The console compares it against `version` to decide whether DUTY.md still reflects the pack's files, so API consumers need it to reproduce that check. Add the property to `KnowledgePackItem` (and to its required list — the field is always emitted), and show it in the pack list, get, ensure and update response examples.
The drop-rule note claimed rules can be dragged to change their execution priority. There is no ordering mechanism behind it: drop rules carry no order field, and the only reorder endpoints are for channels, escalation rules and incident comment types. Keep the accurate half — rules run sequentially in list order and the first match discards the event — and remove the drag claim.
The silence, inhibit and unsubscribe rule item schemas dropped their `priority` property when the field left the API, but kept `priority` in their `required` list. The schemas then demanded a key the endpoints never return — including in their own response examples. Remove the three stale required entries.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Four drifts between the published API reference and what the backends actually do.
1.
priorityis gone from silence / inhibit / unsubscribe rulesThe matching engine evaluates these rules in creation order, so
prioritynever affected behaviour; it has been removed from the request inputs, the response items and the doc→item transfer.The response item schemas had already dropped the property, but two request schemas and three response examples still carried the field:
CreateDropRuleRequest.priority,UpdateDropRuleRequest.priority— removed/channel/silence/rule/list,/channel/inhibit/rule/list,/channel/unsubscribe/rule/list—priorityremoved from the sample itemsEscalation rules and subscription rules keep
priorityand are untouched — theirs is genuinely used for matching and ordering.2. The rule item schemas still required
priorityInhibitRuleItem,SilenceRuleItemandUnsubscribeRuleItemlost thepriorityproperty when the field left the API but keptpriorityin theirrequiredlist, so each schema demanded a key its endpoint never returns — including in its own response examples. The three stale entries are removed.(
AlertRuleInfoResponsealso lists required names it does not declare inline, but that one is deliberate: it is anallOfoverAlertRulethat tightens which server-assigned fields are guaranteed present. Left alone.)3.
duty_versionis missing from the knowledge pack itemKnowledgePackItemnow carriesduty_version, the pack version at whichDUTY.mdwas last authored or re-affirmed; the console compares it againstversionto decide whetherDUTY.mdstill reflects the pack's files. The field is always emitted, so it is added to the schema'srequiredlist and to the pack list / get / ensure / update response examples.Affects
/safari/knowledge/pack/list,/safari/knowledge/get,/safari/knowledge/pack/ensure,/safari/knowledge/pack/update.4. Drop rules cannot be reordered
The drop-rule note claimed rules can be dragged to change their execution priority. There is no ordering mechanism behind it — drop rules carry no order field, and the only reorder endpoints are for channels, escalation rules and incident comment types. The accurate half (sequential list order, first match discards the event) is kept.
This one is prose-only and can be dropped independently of the three spec commits if you would rather confirm the console behaviour first.
Scope
No endpoint was added, removed, or had its auth changed: the gateway registry lists 337
app_key-callable rows and the reference documents exactly those 337 — the two sets match in both directions.Checks
python3 scripts/lint_openapi.py— clean (12 spec files, no violations)requirednames a property it declares, except the intentionalallOfcase noted aboveopenapi.{en,zh}.jsonmatch the per-module files — 337 paths, 707 schemas, 0 content differencesdocs.jsonnav and bothapi-catalog.mdxindexes still reconcile at 337 operations